<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    
</head>
<body>
    <div id="app-one">
        <greeting></greeting>
    </div>
    <div id="app-two">
        <greeting></greeting>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        /* 全局组件 */
        Vue.component("greeting",{
            template:`
                <div>
                    {{ name }}组件的基本使用
                    <button v-on:click="changeName" v-show="!buttonShow">改名</button>
                </div>
            `,
            data:function(){
                return{
                    name:"张三",
                    buttonShow:false
                }
            },
            methods:{
                changeName:function(){
                    this.name = "李四";
                    this.buttonShow = !this.buttonShow;
                }
            }
        })
        new Vue({
            el:"#app-one",
            data:{

            },
            methods:{
               
            },
            computed:{
                
            }
            
        });

        new Vue({
            el:"#app-two",
        });
        
    </script>
</body>
</html>